; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple=aarch64 %s -o - | FileCheck %s

define void @test_frameindex_cmp() {
; CHECK-LABEL: test_frameindex_cmp:
; CHECK:       // %bb.0:
; CHECK-NEXT:    str x30, [sp, #-16]! // 8-byte Folded Spill
; CHECK-NEXT:    .cfi_def_cfa_offset 16
; CHECK-NEXT:    .cfi_offset w30, -16
; CHECK-NEXT:    cmn sp, #12
; CHECK-NEXT:    b.eq .LBB0_2
; CHECK-NEXT:  // %bb.1: // %bb1
; CHECK-NEXT:    bl bar
; CHECK-NEXT:  .LBB0_2: // %common.ret
; CHECK-NEXT:    ldr x30, [sp], #16 // 8-byte Folded Reload
; CHECK-NEXT:    ret
  %stack = alloca i8
  %stack.int = ptrtoint ptr %stack to i64
  %cmp = icmp ne i64 %stack.int, 0
  br i1 %cmp, label %bb1, label %bb2

bb1:
  call void @bar()
  ret void

bb2:
  ret void
}

declare void @bar()
